package com.example.bankend.vo;

import lombok.Data;

import java.math.BigDecimal;
import java.sql.Timestamp;

/**
 * @author luolinila
 * @date 2025/6/18 10:50
 */
@Data
public class CardResult {
    private String cardID;
    private String cusID;
    private String openDate;
    private BigDecimal balance;
    private String savingName;
    private String customerName;
    private String isReportLoss;

    public CardResult(String newCardID, String newCusID, Timestamp newOpenDate, BigDecimal newBalance, String newSavingName, String newCusutomerName, String newIsReportLoss) {
        this.cardID = newCardID;

        this.cusID = newCusID;
        String tempOpenDate = newOpenDate.toString();
        this.openDate = tempOpenDate.substring(0, 10);
        this.balance = newBalance;
        this.savingName = newSavingName;
        StringBuffer customeerName = new StringBuffer(newCusutomerName);
        for (int i = 1; i < customeerName.length(); i++) {
            customeerName.setCharAt(i, '*');
        }
        this.customerName = customeerName.toString();
        this.isReportLoss = newIsReportLoss;
    }
}
